<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>margin重叠问题</title>
    <link rel="stylesheet" href="./global.css">
    <style>
        .top {
            width: 200px;
            height: 200px;
            background: red;
            margin-bottom: 50px;
        }
        .bottom {
            width: 200px;
            height: 200px;
            background: green;
            margin-top: 100px;
        }
        button {
            width: 40px;
            height: 40px;
            margin: 0 40px;
        }
    </style>
</head>
<body>
    <div class="top"></div>
    <div class="bottom"></div>
    <button>nihao</button><button>ok</button>

    <div class="learn">
        <h1>学习总结</h1>

        <p>
            当上下相邻的<strong>普通盒子</strong>设置了margin值，实际的margin值
            <b>并非</b>是上下margin的总和,而是<b>取margin中最大的值</b>
        </p>

        <h2>注意事项</h2>
        <ul>
            <li>只有上下相邻才存在该问题，左右相邻取margin的和</li>
        </ul>
    </div>
</body>
</html>